﻿using System.Windows.Forms;
using System.Drawing;

namespace CSSMixer
{
    class CheckedToolstripRenderer : ToolStripProfessionalRenderer
    {
        protected override void OnRenderButtonBackground(ToolStripItemRenderEventArgs e)
        {
            var btn = e.Item as ToolStripButton;
            if (btn != null && btn.CheckOnClick && btn.Checked)
            {
                Rectangle bounds = new Rectangle(Point.Empty, e.Item.Size);
                e.Graphics.FillRectangle(Brushes.Chartreuse, bounds);
                e.Graphics.DrawRectangle(Pens.DarkGray, bounds);
            }
            else
            {
                base.OnRenderButtonBackground(e);
            }
        }
       
    }
}


